<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>搜事网-用户管理</title>
<!-- 引用文件:start-->
<jsp:include page="includes.jsp" />
<%@ page language="java" contentType="text/html;charset=UTF-8"
	import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!-- 引用文件:end-->
<!-- JS头文件:start -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>
<script src="http://malsup.github.com/jquery.form.js"></script>
<script>
	// wait for the DOM to be loaded     
	$(document).ready(function() {
		$('#myForm').ajaxForm(function() {
			//alert("Thank you for your comment!");
		});
	});
</script>
<!-- JS头文件:end -->
</head>
<body>
	<div class="wrap">
		<!-- header:start -->
		<jsp:include page="banner.jsp" />
		<!-- header:end -->
		<div id="body">
			<h1 class="page">
				<span>用户管理</span>
			</h1>
			<div id="left" class="wrap">
				<div class="main lside176">
					<jsp:include page="left_banner.jsp" />
					<div class="middle w804">
						<div id="left" class="w804">
							<div class="main">
								<div class="topbox">
									<div class="tabs">
										<a href="listUser.do"><span>用户管理</span></a> <a
											href="listUserGroup.do"><span>用户组管理</span></a>
									</div>
								</div>
								<div class="tabContent">
									<div class="listForm">
										<button class="btn modify" onclick="newUser()">新建</button>
										<button name="delselect" class="btn delete" type="submit"
											onclick="document.delForm.submit()">删除</button>

										<form action="deleteUser.do" name="delForm" method="post">
											<font style="color: red"><strong><s:property
														value="errorMsg" /></strong></font>
											<s:if test="users.size>0">
												<table class="t" width="100%" cellspacing="1">
													<tr class="odd">
														<td></td>
														<td>登录名</td>
														<td>手机</td>
														<td>邮箱</td>
														<td>真实姓名</td>
														<td>用户组</td>
														<td>最后登录时间</td>
														<td></td>

													</tr>
													<s:iterator value="users">
														<tr>
															<td><input type="checkbox" name="delIds"
																value="${id}" /></td>
														<td><s:property value="loginName" /></td>
															<td><s:property value="mobile" /></td>
															<td><s:property value="email" /></td>
															<td><s:property value="name" /></td>
															<td><s:property value="userGroup.name" /></td>
															<td><s:property value="lastLogin" /></td>
															<td><a href="editUser.do?userId=${id}">[编辑]</a></td>
														</tr>
													</s:iterator>
												</table>
											</s:if>
										</form>
										<!-- 分页:start -->
										<div class="pagination">
											<s:if test="curPage!=1">
												<a href="listUser.do?curPage=1&pageSize=${pageSize}">首页</a>
												<a
													href="listUser.do?curPage=${curPage-1}&pageSize=${pageSize}">上一页</a>
											</s:if>
											<s:if test="curPage!=totalPage">
												<a
													href="listUser.do?curPage=${curPage+1}&pageSize=${pageSize}">下一页</a>
												<a
													href="listUser.do?curPage=${totalPage}&pageSize=${pageSize}">末页</a>
											</s:if>
											当前
											<s:property value="curPage" />
											/
											<s:property value="totalPage" />
											页
										</div>
										<!-- 分页:end -->
										<script>
											function saveUser() {
												document
														.getElementById('dialog').style.display = 'none';
												document.getElementById(
														'myForm').submit();
											}
											function newUser() {
												document
														.getElementById('dialog').style.display = 'block';
											}
										</script>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="clear"></div>
				</div>
			</div>
		</div>
	</div>

	<div class="dialogLayer" id="dialog" style='display: none'>
		<div class="mask">
			<iframe frameborder="0" width="100%" height="100%"
				src="transparent.html" allowtransparency="true"></iframe>
		</div>
		<div class="pos1" style="width: 600px;">
			<div class="pos2">
				<div class="dialog">
					<a class="close" href="javascript:void(0)"
						onclick="var P='parentNode'; this[P][P][P][P].style.display='none'"></a>
					<form id="myForm" action="saveUser.do" method="post">
						<h1>新建用户</h1>

						<div>
							<table class="infoTable" width="100%" cellspacing="1">

								<tr>
									<td class="h">用户名</td>
									<td><label><span class="inputtxt"> <input
												type="text" name="username" value="" />
										</span></label></td>
									<td class="h">密码</td>
									<td><label><span class="inputtxt"> <input
												type="text" name="password" value="" />
										</span></label></td>
								</tr>

								<tr>
									<td class="h">手机</td>
									<td><label><span class="inputtxt"> <input
												type="text" name="mobile" value="" />
										</span></label></td>
									<td class="h">座机</td>
									<td><label><span class="inputtxt"> <input
												type="text" name="phone" value="" />
										</span></label></td>
								</tr>

								<tr>
									<td class="h">真实姓名</td>
									<td><label><span class="inputtxt"> <input
												type="text" name="name" value="" />
										</span></label></td>
									<td class="h">邮箱</td>
									<td><label><span class="inputtxt"> <input
												type="text" name="email" value="" />
										</span></label></td>
								</tr>


								<tr>
									<td class="h">用户组</td>
									<td><label><span class="inputtxt"> <select
												name="userGroup">
													<s:iterator value="userGroups">
														<option value="${id}">
															<s:property value="name" />
														</option>
													</s:iterator>
											</select>
										</span></label></td>
									<td></td>
									<td></td>
								</tr>

							</table>
							<hr />
							<p>
								<input class="btn" type="button" onclick="saveUser()" value="确认" />
								&emsp;
								<button class="btn" type="button"
									onclick="document.getElementById('dialog').style.display='none'">取消</button>
							</p>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>


</body>
</html>
